翻訳と辞書
Words near each other
・ Process patterns
・ Process performance index
・ Process performance qualification protocol
・ Process philosophy
・ Process psychology
・ Process qualification
・ Process reference models
・ Process safety
・ Process safety management
・ Process Shot
・ Process simulation
・ Process specification
・ Process Specification Language
・ Process state
・ Process study
Process substitution
・ Process supervision
・ Process Systems Design and Control Laboratory
・ Process theology
・ Process theory
・ Process theory of composition
・ Process tomography
・ Process tracing
・ Process trailer
・ Process validation
・ Process variable
・ Process variation (semiconductor)
・ Process Vision
・ Process Vision (Dutch company)
・ Process window


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Process substitution : ウィキペディア英語版
In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file. The command is substituted in-line, where a file name would normally occur, by the command shell. This allows programs that normally only accept files to directly read from or write to another program.==Example==The following examples use Bash syntax.The Unix diff command normally accepts the names of two files to compare, or one file name and standard input. Process substitution allows you to compare the output of two programs directly:$ diff The expression tells the command interpreter to run ''command'' and make its output appear as a file. The ''command'' can be any arbitrarily complex shell command.Without process substitution, the alternatives are:1. Save the output of the command(s) to a temporary file, then read the temporary file(s).$ sort file2 > /tmp/file2.sorted$ sort file1 | diff - /tmp/file2.sorted$ rm /tmp/file2.sorted2. Create a named pipe (also known as a FIFO), start one command writing to the named pipe in the background, then run the other command with the named pipe as input.$ mkfifo /tmp/sort2.fifo$ sort file2 > /tmp/sort2.fifo &$ sort file1 | diff - /tmp/sort2.fifo$ rm /tmp/sort2.fifoBoth alternatives are more cumbersome.Process substitution can also be used to capture output that would normally go to a file, and redirect it to the input of a process. The Bash syntax for writing to a process is >(command). Here is an example using the tee, wc and gzip commands that counts the lines in a file with wc -l and compresses it with gzip in one pass:$ tee >(wc -l >&2) bigfile.gz
In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file. The command is substituted in-line, where a file name would normally occur, by the command shell. This allows programs that normally only accept files to directly read from or write to another program.
==Example==
The following examples use Bash syntax.
The Unix diff command normally accepts the names of two files to compare, or one file name and standard input. Process substitution allows you to compare the output of two programs directly:

$ diff <(sort file1) <(sort file2)

The <(command) expression tells the command interpreter to run ''command'' and make its output appear as a file. The ''command'' can be any arbitrarily complex shell command.
Without process substitution, the alternatives are:


1. Save the output of the command(s) to a temporary file, then read the temporary file(s).

$ sort file2 > /tmp/file2.sorted
$ sort file1 | diff - /tmp/file2.sorted
$ rm /tmp/file2.sorted

2. Create a named pipe (also known as a FIFO), start one command writing to the named pipe in the background, then run the other command with the named pipe as input.

$ mkfifo /tmp/sort2.fifo
$ sort file2 > /tmp/sort2.fifo &
$ sort file1 | diff - /tmp/sort2.fifo
$ rm /tmp/sort2.fifo


Both alternatives are more cumbersome.
Process substitution can also be used to capture output that would normally go to a file, and redirect it to the input of a process. The Bash syntax for writing to a process is >(command). Here is an example using the tee, wc and gzip commands that counts the lines in a file with wc -l and compresses it with gzip in one pass:

$ tee >(wc -l >&2) < bigfile | gzip > bigfile.gz


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file. The command is substituted in-line, where a file name would normally occur, by the command shell. This allows programs that normally only accept files to directly read from or write to another program.==Example==The following examples use Bash syntax.The Unix diff command normally accepts the names of two files to compare, or one file name and standard input. Process substitution allows you to compare the output of two programs directly:$ diff The expression tells the command interpreter to run ''command'' and make its output appear as a file. The ''command'' can be any arbitrarily complex shell command.Without process substitution, the alternatives are:1. Save the output of the command(s) to a temporary file, then read the temporary file(s).$ sort file2 > /tmp/file2.sorted$ sort file1 | diff - /tmp/file2.sorted$ rm /tmp/file2.sorted2. Create a named pipe (also known as a FIFO), start one command writing to the named pipe in the background, then run the other command with the named pipe as input.$ mkfifo /tmp/sort2.fifo$ sort file2 > /tmp/sort2.fifo &$ sort file1 | diff - /tmp/sort2.fifo$ rm /tmp/sort2.fifoBoth alternatives are more cumbersome.Process substitution can also be used to capture output that would normally go to a file, and redirect it to the input of a process. The Bash syntax for writing to a process is >(command). Here is an example using the tee, wc and gzip commands that counts the lines in a file with wc -l and compresses it with gzip in one pass:$ tee >(wc -l >&2) bigfile.gz」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.